//
//  OYCategoriesController.h
//  ObjectiveYouTube
//
//  Created by Tristan O'Tierney on 3/15/08.
//  Copyright 2008 Tristan O'Tierney. All rights reserved.
//

#import <ObjectiveYouTube/ObjectiveYouTube.h>

@interface OYCategoriesController : NSObject {
	NSMutableArray *_categories;
	id _delegate;
	NSURLConnection *_connection;
	NSMutableData *_data;
}

- (id)initWithDelegate:(id)delegate;

- (void)refreshCategories;
- (void)cancelRefresh;
- (BOOL)isRefreshing;

- (NSArray *)categories;

- (id)delegate;
- (void)setDelegate:(id)delegate;
@end

// Informal protocol
@interface NSObject (OYCategoriesDelegate)
- (void)categories:(OYCategoriesController *)categories refreshedWithCategories:(NSArray *)categoriesArray;
- (void)categories:(OYCategoriesController *)categories refreshFailedWithError:(NSError *)error;
@end